home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 2 / 002.d81 / chemistry drill (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  7KB  |  241 lines

  1. 10 rem chemistry drill by kurt bruce
  2. 20 rem translated for the commodore 64 by donna k. woody
  3. 30 :
  4. 40 poke53272,23:rem selects upper/lower case
  5. 50 printchr$(8):rem disables c/shift keys
  6. 55 cr$=chr$(141)
  7. 60 poke53280,3 :rem set border color to cyan
  8. 70 poke53281,1 :rem set background color to white
  9. 80 printchr$(156):rem set character color to purple
  10. 90 :
  11. 100 rem initial set up
  12. 110 :
  13. 120 dimq$(50),a$(50),r(50)
  14. 130 drill$="[195][160][200][160][197][160][205][160][201][160][211][160][212][160][210][160][217][160][160][160][196][160][210][160][201][160][204][160][204]"
  15. 140 s$(1)="[207]ops, wrong.  [212]hat's [207][203], "+name$+"."
  16. 150 s$(2)="[215]rong.  [212]hink harder, "+name$+"."
  17. 160 s$(3)="[215]rong again, "+name$+"!!!"
  18. 170 s$(4)="[195]ome on!!! [193]t least try, "+name$+"!"
  19. 180 press$="[208]ress space bar to continue"
  20. 190 :
  21. 200 gosub 1930:rem title page
  22. 210 goto290
  23. 220 :
  24. 230 rem get subroutine
  25. 240 :
  26. 250 poke204,0:poke207,0:getz$:return
  27. 260 :
  28. 270 rem menu
  29. 280 :
  30. 290 printchr$(147):wr=0
  31. 300 print"[215]hich would you like to give:"
  32. 310 print:printtab(5)"1.  [197]lement names"
  33. 320 printtab(5)"2.  [197]lement symbols"
  34. 330 printtab(5)"3.  [210]adical names"
  35. 340 printtab(5)"4.  [210]adical symbols"
  36. 350 printtab(5)"5.  [207]xidation states"
  37. 360 printtab(5)"6.  [211]olubility rule numbers"
  38. 370 printtab(5)"7.  [197]xit [208]rogram"
  39. 380 print:print
  40. 390 print"[197]nter your choice (1 - 7): ";
  41. 400 gosub250:ifz$=""then400
  42. 410 poke204,1:print
  43. 420 c=val(z$):ifc<1orc>7then460
  44. 430 ifc=7then450
  45. 440 print"[208]lease wait..."
  46. 450 oncgoto470,480,490,500,510,520,530
  47. 460 print"[208]lease enter a number between 1 and 7.[145][145][145][145][145][145][145]":goto390
  48. 470 n=50:p$="[211]ymbol":i$="[197]lement":goto570
  49. 480 n=50:p$="[197]lement":i$="[211]ymbol":goto570
  50. 490 n=33:p$="[211]ymbol":i$="[206]ame":goto570
  51. 500 n=33:p$="[206]ame":i$="[211]ymbol":goto570
  52. 510 n=17:p$="[197]lement":i$="[207]xidation [211]tate":goto570
  53. 520 n=7:p$="[210]ule":i$="[210]ule #":
  54. 530 ifc=7then1410
  55. 540 :
  56. 550 rem read data statements
  57. 560 :
  58. 570 fori=1to50
  59. 580 ifc=1thenreada$(i),q$(i)
  60. 590 ifc<>1thenreadq$(i),a$(i)
  61. 600 next
  62. 610 ifc=1orc=2then 740
  63. 620 fori=1to33
  64. 630 ifc=3thenreadq$(i),a$(i)
  65. 640 ifc<>3thenread a$(i),q$(i)
  66. 650 next
  67. 660 ifc=3orc=4then 740
  68. 670 fori=1to17
  69. 680 ifc>=5then reada$(i),q$(i)
  70. 690 next
  71. 700 ifc=5then 740
  72. 710 fori=1to7
  73. 720 readq$(i),a$(i)
  74. 730 next
  75. 740 printchr$(147)
  76. 750 print"[200]ow many questions, ";name$
  77. 760 print"   (1 - ";n;"): ";
  78. 770 poke 19,32:inputq$:q=val(q$):print
  79. 780 ifq<=ngoto810
  80. 790 print"[211]orry. [201] only have ";n;" questions"
  81. 800 print"ready.  [208]lease enter ";n;" or less.[145][145][145][145][145][145][145][145][145][145][145][145][145][145][145][145][145][145][145][145]":goto760
  82. 810 print"[208]lease wait while [201] select the questions"
  83. 820 forj=1toq
  84. 830 r(j)=int(rnd(1)*n)+1
  85. 840 ifj=1then880
  86. 850 fork=1toj-1
  87. 860 ifr(j)=r(k)then830
  88. 870 nextk
  89. 880 nextj
  90. 890 forj=1toq
  91. 900 printchr$(147)
  92. 910 printtab(6);drill$
  93. 920 printtab(14)"[209][213][197][211][212][201][207][206] #[160]";j
  94. 930 print"[212]he ";p$;" is: ";:ifc=6thenprint
  95. 940 printa$(r(j))
  96. 950 z1=0
  97. 960 print"[206]ow, ";name$;", give the corresponding":print
  98. 970 printi$;": ";
  99. 980 inputa$:print
  100. 990 ifasc(a$)>65andasc(a$)<90thena$=chr$(asc(a$)+128)+mid$(a$,2)
  101. 1000 ifa$=q$(r(j))then 1120
  102. 1010 ifz1>1then 1050
  103. 1020 ifleft$(a$,3)<>left$(q$(r(j)),3)then1050
  104. 1030 ifj>1thenprint"[145][145]"
  105. 1040 print"[205]isspelled... [212]ry again.[145][145][145][145]":z1=z1+1:goto970
  106. 1050 wr=wr+1
  107. 1060 ifj>1thenprint"[145][145]"
  108. 1070 ifwr<3thenprints$(1)
  109. 1080 ifwr>2andwr<6thenprints$(2)
  110. 1090 ifwr>5andwr<10thenprints$(3)
  111. 1100 ifwr>9thenprints$(4)
  112. 1110 print"[210]ight answer is: ";q$(r(j)):goto 1180
  113. 1120 r1=int(rnd(1)*3)+1
  114. 1130 ifj>1thenprint"[145][145]"
  115. 1140 onr1goto1150,1160,1170
  116. 1150 print"[199]ood [211]how!                ":goto 1180
  117. 1160 print"[197]xcellent!!               ":goto 1180
  118. 1170 print"[202]olly [199]ood!               "
  119. 1180 ifc=6thenprint"[145][145]"
  120. 1190 ifc=6anda$<>q$(r(j))thenprint"[145][145][145]"
  121. 1200 print"";press$;
  122. 1210 gosub250:ifz$=""then1210
  123. 1220 poke204,1
  124. 1230 nextj
  125. 1240 printchr$(147)
  126. 1250 p=int(((q-wr)/q)*100)
  127. 1260 printtab(6);drill$
  128. 1270 print"":printname$;", you did ";q-wr;" correctly"
  129. 1280 print"out of ";q
  130. 1290 ifp>89thenprint"[198]ine job.  [217]ou've studied enough.":goto1350
  131. 1300 ifp<60thenprint"[194]y your score, you must be failing...":goto1350
  132. 1310 print"[206]ot bad, but you'd better study some    more."
  133. 1320 :
  134. 1330 :rem end routine
  135. 1340 :
  136. 1350 print"[193]nother test (y/n)[160]";
  137. 1360 gosub250:ifz$=""then1360
  138. 1370 poke204,1
  139. 1380 ifz$="n" then 1410
  140. 1390 ifz$="y"then restore:goto 290
  141. 1400 print"[145][145][145][145]":goto1350
  142. 1410 poke19,0
  143. 1420 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
  144. 1425 poke631,13:poke632,13:poke198,2:end
  145. 1430 rem data statements
  146. 1440 :
  147. 1450 :
  148. 1460 rem elements names & symbols
  149. 1470 :
  150. 1480 data"[200]","[200]ydrogen","[200]e","[200]elium","[204]i","[204]ithium","[194]e","[194]eryllium","[194]"
  151. 1490 data"[194]oron","[195]","[195]arbon","[206]","[206]itrogen","[207]","[207]xygen","[198]","[198]luorine","[206]e"
  152. 1500 data"[206]eon","[206]a","[211]odium","[205]g","[205]agnesium","[193]l","[193]luminum","[211]i","[211]ilicon"
  153. 1510 data"[208]","[208]hosphorus","[211]","[211]ulfur","[195]l","[195]hlorine","[193]r","[193]rgon"
  154. 1520 data"[203]","[208]otassium","[195]a","[195]alcium","[211]c","[211]candium","[212]i","[212]itanium","[214]"
  155. 1530 data"[214]anadium","[195]r","[195]hromium","[205]n","[205]anganese","[198]e","[201]ron","[195]o","[195]obalt"
  156. 1540 data"[206]i","[206]ickle","[195]u","[195]opper","[218]n","[218]inc","[193]s","[193]rsenic","[194]r","[194]romine"
  157. 1550 data"[203]r","[203]rypton","[210]b","[210]ubidium","[211]r","[211]trontium","[205]o","[205]olybdenum","[193]g"
  158. 1560 data"[211]ilver","[195]d","[195]admium","[211]n","[212]in","[211]b","[193]ntimony","[201]","[201]odine","[195]s"
  159. 1570 data"[195]esium","[194]a","[194]arium","[215]","[212]ungsten","[208]t","[208]latinum","[193]u","[199]old","[200]g"
  160. 1580 data"[205]ercury","[208]b","[204]ead","[194]i","[194]ismuth","[213]","[213]ranium"
  161. 1590 :
  162. 1600 rem radical names & symbols
  163. 1610 :
  164. 1620 data"[193]cetate","[195]2[200]302-1","[193]mmonium","[206][200]4+1","[194]icarbonate","[200][195][207]3-1"
  165. 1630 data"[194]isulfate","[200][211][207]4-1","[194]isulfite","[200][211][207]3-1","[200]ypochlorite","[195]l[207]-1"
  166. 1640 data"[195]hlorite","[195]l[207]2-1","[195]hlorate","[195]l[207]3-1","[208]erchlorate","[195]l[207]4-1"
  167. 1650 data"[208]ermanganate","[205]n[207]4-1","[206]itrate","[206][207]3-1","[200]ydroxide","[207][200]-1","[206]itrite"
  168. 1660 data"[206][207]2-1","[195]yanide","[195][206]-1","[195]arbonate","[195][207]3-2","[211]ulfite","[211][207]3-2"
  169. 1670 data"[211]ulfate","[211][207]4-2","[205]anganate","[205]n[207]4-2","[207]xalate","[195]2[207]4-2","[195]hromate"
  170. 1680 data"[195]r[207]4-2","[196]ichromate","[195]r2[207]7-2","[208]hosphate","[208][207]4-3","[193]rsenate","[193]s[207]4-3"
  171. 1690 data"[195]uprous","[195]u+1","[195]upric","[195]u+2","[198]errous","[198]e+2","[198]erric","[198]e+3"
  172. 1700 data"[211]tannous","[211]n+2","[211]tannic","[211]n+4","[208]lumbous","[208]b+2","[208]lumbic","[208]b+4"
  173. 1710 data"[205]ercurous","[200]g2+2","[205]ercuric","[200]g+2"
  174. 1720 :
  175. 1730 rem oxidation states
  176. 1740 :
  177. 1750 data"[194]e","+2","[204]i","+1","[218]n","+2","[193]g","+1","[206]a","+1","[203]","+1","[205]g","+2"
  178. 1760 data"[195]a","+2","[194]a","+2","[193]l","+3","[207]","-2","[211]","-2","[194]r","-1","[201]","-1"
  179. 1770 data"[195]l","-1","[198]","-1","[200]","+1"
  180. 1780 :
  181. 1790 rem solubility rule numbers
  182. 1800 :
  183. 1810 data1,"[193]ll [206]a, [206][200]4+1, and [203] compounds are      soluble"
  184. 1820 data2,"[193]ll [206]itrates, [193]cetates, and [195]hlorates   are soluble"
  185. 1830 data3,"[193]ll [200]alides are soluble except: [193]g, [200]g, and [208]b"
  186. 1840 data4,"[193]ll [211]ulfates are soluble except: [194]a,    [195]a, [211]r, [210]a, and [208]b"
  187. 1850 data5
  188. 1860 data"[193]ll [207]xides are insoluble except: [210]ule 1  & [199]roup [201][201] which will react"
  189. 1870 data6
  190. 1880 data"[193]ll [200]ydroxides & [211]ulfides are insoluble except